<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="jquery-1.3.1.js" type="text/javascript"></script>
<script src="1.js" type="text/javascript"></script>

<script type="text/javascript">
$(function () {
	$.ajaxSetup ({ 
		cache: false 
	});


    $("#area_p").load("test2.php?action=province");

	//$("#type_p").load("test2.php?action=province");

	$("#area_p").change(function () {
		$("#area_c").load("test2.php?action=city&pid="+$('#area_p').val());
		//alert("hi!")
			
	})
	$("#area_c").change(function () {
		$("#area_a").load("test2.php?action=area&pid="+$('#area_c').val());
		//alert("hi!")
			
	})

    $("#search_btn").click(function () {
        $("#search_rs").css("display","block");
			$.post("test2.php?action=search&aid="+$('#area_a').val(), { 
						search :  $("#user_search").val()  
					}, function (data, textStatus){
                        $("#search_rs").html(data); // 把返回的数据添加到页面上
					}
			);
    })

        $("#hide_btn").click(function () {
			$("#search_rs").css("display","none");

          // alert("hi@");
    })

/*
	$("#area_a").change(function () {
		//$("#search_rs").load("test2.php?action=search&aid="+$('#area_a').val());
		alert($('#area_a').val())
			
	})
*/


    		$("li").click(function () {
                alert("hi");
			$(this).css("background","red")
			.siblings().css("background","#aef");
			//alert(this.id);
			//$("#sh1").val()=$(this.)
			var t = $(this).text();
			//var t = this.text;
			var aid = this.id;
			alert(t);
			$("#s").attr("value",t);
			$("#p1").attr("value",aid);
			//var v =$("#s").val();
			//v=$(this).text();
			//alert(v);

		})

})



</script>


<style type="text/css">
#list{
	width:400px;
}
	ul{list-style:none;}
	ul li{
		float:left;
		padding:5px;b
		margin:3px;
		background:#aef;
		display:block;
	}
</style>


<title>无标题文档</title>
</head>

<body>

<form method=post action="" id="search_form">
    

<select  style='width: 160px;' class='f-input' name='area_p' id='area_p'>
<option value="">==请选择省==</option>
</select>


<select  style='width: 160px;' class='f-input' name='area_c' id='area_c' >
<option value="">==请选择市==</option>
</select>


<select  style='width: 160px;' class='f-input' name='area_a' id='area_a' >
<option value="">==请选择商业区域==</option>
</select>

<hr/>

搜索:<input type="text" name="search" id="user_search">
<input type="button" value="提交查询" id="search_btn">
<input type='button' value='隐藏查询结果' id='hide_btn'>
</form>


<div id="search_rs" class="search_rs">


</div>


<div id="" class="" style="clear:both"></div>
<hr/>
<form method=post action="1.php">
	商户:<input type="text" name="sh" value="商户"  id="s" disabled>
		<input type="hidden" name="p_id" value="商户" id="p1">
		<input type="submit" value="sub">
</form>

<!--  

<div id="type_p" class="type_p"></div>
<div id="type_c" class="type_c"></div>
<div id="type_a" class="type_a"></div>
-->

</body>
</html>